
<!DOCTYPE html><html><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta content="telephone=no" name="format-detection">
    <title>我的消费</title>
    <link rel="stylesheet" type="text/css" href="http://client.liulianggo.com/skm/static/css/activity/skmobile.css">
    <!-- -->
    <script type="text/javascript" src="http://client.liulianggo.com/skm/assets/javascript/jquery-2.1.3.min.js"></script>
    <script type="text/javascript" src="http://client.liulianggo.com/skm/assets/javascript/fastclick.min.js"></script>
    <script type="text/javascript" src="http://client.liulianggo.com/skm/assets/javascript/spin.min.js"></script><style type="text/css">
   
   </style>
</head>
<body>


<div class="selectbox">
    选择月份
    <p class="select">
        <span id="time">
            {$monthStr}
        </span>
        <i>
        </i>
    </p>
    <div class="yuefen">
    	{foreach item=t key=k from=$monthArray}
        <p>
            {$t}
            <input class="shijian" type="hidden" value="{$k}">
        </p>
        {/foreach}
    </div>
</div>
<div class="orderbox">
    {foreach item=t from=$order}
    <div class="order">
        <p class="p1">
            <span class="fr">
                ￥{$t.bonues_price}元
            </span>
            充值号码：
            <span>
                {$t.phone}
            </span>
        </p>
        <p class="p2">
            <span class="fr ">
                {$t.status_name}
            </span>
            {if $t.status eq 0}
            <span class="fr"><a class ="red" href="/pay/payDetail.php?orderId={$t.id}">立即支付&gt;</a></span>
            {/if}
            [{$t.mobile_type_name}{$t.mb_value}M] {$t.range_name}可用 当月有效
        </p>
    </div>
    {/foreach}
</div>

<script type="text/javascript">
    $(function(){
        FastClick.attach(document.body);
        var target = document.getElementById('spin');
        new Spinner({
            color: "#fff"
        }).spin(target);

        $('.select').click(function(){
            $('.yuefen').show();
        });
        $('.yuefen p').click(function(){
            var time = $(this).text();
            var shijian = $(this).find('.shijian').val();
            $('#time').html(time);
            $(this).parent().hide();
            $.ajax({
                url:'wap.php?m=order&a=get&',
                type:'post',
                dataType:'json',
                data:{
                    'month':shijian
                },
                beforSend:function(){
                    $('#spin').show();
                },
                success:function(data){
                    var list = data.orders;

                    $('#spin').hide();
                    var html = '';
                    $('.orderbox').empty();

                    var arrNew = new Array();

                    if(list !== undefined){

                        for(var i=0;i<list.length;i++){

                            var orderId = list[i]['id'];
                            var price = list[i]['bonues_price'];
                            var phone = list[i]['phone'];
                            var prodId = list[i]['product_id'];
                            var statusName = list[i]['status_name'];
                            var rangeName = list[i]['range_name'];
                            var mobileTypeName = list[i]['mobile_type_name'];
                            var mbValue = list[i]['mb_value'];
                            var code = parseInt(list[i]['status']);
                                switch (code){
                                    case 0:
                                        html+='<div class="order"><p class="p1"><span class="fr">￥'+price+'元</span>充值号码：'+phone+'</p><p class="p2"><span class="fr"><a class ="red" href="/pay/payDetail.php?orderId='+orderId+'">立即支付&gt;</a></span>[' + mobileTypeName + mbValue + 'M] ' + rangeName + '可用 当月有效</p></div>';
                                        break;
                                    default:
                                        html+='<div class="order"><p class="p1"><span class="fr">￥'+price+'元</span>充值号码：'+phone+'</p><p class="p2"><span class="fr">' + statusName + '</span>[' + mobileTypeName + mbValue + 'M] ' + rangeName + '可用 当月有效</p></div>';
                                        break;
                                }
                        }
                    }
                    $('.orderbox').append(html);

                },
                error:function(){
                    alert('请求超时')
                }

            })
        })
    })
</script>

</body></html>